package com.hackerrank.challenges.houselocation;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	private static class Coordinate {
		int x, y;
		public Coordinate(int x, int y) {
			this.x = x;
			this.y = y;
		}
	}
	private static class Circle {
		// a * x * x + a * y * y + b * x + c * y + d = 0
		int a, b, c, d;
		public Circle(int a, int b, int c, int d) {
			int g = gcf(a, b, c, d);
			this.a = a / g;
			this.b = b / g;
			this.c = c / g;
			this.d = d / g;
		}
		public QuadraticEquation getQEY(double x) {
			return new QuadraticEquation(a, c, a * x * x + b * x + d);
		}
		public QuadraticEquation getQEX(double y) {
			return new QuadraticEquation(a, b, a * y * y + c * y + d);
		}
		public double getRadius() {
			return 0.5 * Math.sqrt(b * b + c * c - 4 * a * d) / a;
		}
		public String toString() {
			return a + " * x * x + " + a + " * y * y + " + b + " * x + " + c + " * y + " + d + " = 0, center: (" + -0.5 * b / a + ", " + -0.5 * c / a + "), radius: " + getRadius();
		}
	}
	private static class Line {
		// a * x + b * y + c = 0
		int a, b, c;
		public Line(int a, int b, int c) {
			int g = gcf(a, b, c);
			this.a = a / g;
			this.b = b / g;
			this.c = c / g;
		}
		public String toString() {
			return a + " * x + " + b + " * y + " + c + " = 0";
		}
	}
	private static class QuadraticEquation {
		// a * x * x + b * x + c = 0
		int a, b;
		double c;
		public QuadraticEquation(int a, int b, int c) {
			int g = gcf(a, b, c);
			this.a = a / g;
			this.b = b / g;
			this.c = c / g;
		}
		public QuadraticEquation(int a, int b, double c) {
			this.a = a;
			this.b = b;
			this.c = c;
		}
		public List<Double> solve() {
			List<Double> v = new ArrayList<Double>();
			if(a == 0) {
				v.add(-Double.valueOf(c) / b);
			} else if(b * b > 4 * a * c) {
				double Ox = Math.sqrt(b * b - 4 * a * c);
				v.add(0.5 * (-b + Ox) / a);
				v.add(0.5 * (-b - Ox) / a);
			} else if(b * b == 4 * a * c)
				v.add(-0.5 * b / a);
			return v;
		}
	}
	private static int gcf(int n1, int n2, int n3, int n4) {
		return gcf(gcf(n1, n2), gcf(n3, n4));
	}
	private static int gcf(int n1, int n2, int n3) {
		return gcf(gcf(n1, n2), n3);
	}
	private static int gcf(int n1, int n2) {
		n1 = Math.abs(n1);
		n2 = Math.abs(n2);
		return gcfmm(Math.max(n1, n2), Math.min(n1, n2));
	}
	private static int gcfmm(int n1, int n2) {
		if(n2 == 0)
			return n1;
		return gcfmm(n2, n1 % n2);
	}
	private static QuadraticEquation getQEX(Line l, Circle c) {
		return new QuadraticEquation(c.a * (l.a * l.a + l.b * l.b), 2 * c.a * l.a * l.c - c.c * l.b * l.a + c.b * l.b * l.b, c.a * l.c * l.c - c.c * l.b * l.c + c.d * l.b * l.b);
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt(), b = in.nextInt();
		Coordinate ck = new Coordinate(in.nextInt(), in.nextInt());
		Coordinate cb = new Coordinate(in.nextInt(), in.nextInt());
		Coordinate cj = new Coordinate(in.nextInt(), in.nextInt());
		Coordinate cn = new Coordinate(in.nextInt(), in.nextInt());
		if(a == 1 && b == 1) {
			// intersection of two straight lines
			// we have none, one or infinite solutions
			Line A = new Line(2 * (ck.x - a * a * cb.x), 2 * (ck.y - a * a * cb.y), a * a * (cb.x * cb.x + cb.y * cb.y) - (ck.x * ck.x + ck.y * ck.y));
			Line B = new Line(2 * (cj.x - b * b * cn.x), 2 * (cj.y - b * b * cn.y), b * b * (cn.x * cn.x + cn.y * cn.y) - (cj.x * cj.x + cj.y * cj.y));
			System.out.println(A);
			System.out.println(B);
			if(A.b * B.a == A.a * B.b)
				System.out.println("Impossible!");
			else {
				double x = (A.c * B.b - A.b * B.c) / (A.b * B.a - A.a * B.b);
				double y = (A.a * B.c - A.c * B.a) / (A.b * B.a - A.a * B.b);
				System.out.printf("%.2f %.2f\n", round(x, 2), round(y, 2));
			}
		} else {
			Circle c;
			Line l;
			if(a == 1) {
				// intersection of a straight line and a circle
				// we have none, one or two solutions
				l = new Line(2 * (ck.x - a * a * cb.x), 2 * (ck.y - a * a * cb.y), a * a * (cb.x * cb.x + cb.y * cb.y) - (ck.x * ck.x + ck.y * ck.y));
				c = new Circle(b * b - 1, 2 * (cj.x - b * b * cn.x), 2 * (cj.y - b * b * cn.y), b * b * (cn.x * cn.x + cn.y * cn.y) - (cj.x * cj.x + cj.y * cj.y));
				System.out.println(l);
				System.out.println(c);
			} else if(b == 1) {
				// intersection of a circle and a straight line
				// we have none, one or two solutions
				c = new Circle(a * a - 1, 2 * (ck.x - a * a * cb.x), 2 * (ck.y - a * a * cb.y), a * a * (cb.x * cb.x + cb.y * cb.y) - (ck.x * ck.x + ck.y * ck.y));
				l = new Line(2 * (cj.x - b * b * cn.x), 2 * (cj.y - b * b * cn.y), b * b * (cn.x * cn.x + cn.y * cn.y) - (cj.x * cj.x + cj.y * cj.y));
				System.out.println(c);
				System.out.println(l);
			} else {
				// intersection of two circles
				// we have none, one, two or infinite solutions
				Circle A = new Circle(a * a - 1, 2 * (ck.x - a * a * cb.x), 2 * (ck.y - a * a * cb.y), a * a * (cb.x * cb.x + cb.y * cb.y) - (ck.x * ck.x + ck.y * ck.y));
				Circle B = new Circle(b * b - 1, 2 * (cj.x - b * b * cn.x), 2 * (cj.y - b * b * cn.y), b * b * (cn.x * cn.x + cn.y * cn.y) - (cj.x * cj.x + cj.y * cj.y));
				System.out.println(A);
				System.out.println(B);
				// intersection line for two circles
				l = new Line(B.a * A.b - A.a * B.b, B.a * A.c - A.a * B.c, B.a * A.d - A.a * B.d);
				System.out.println(l);
				c = A;
			}
			if(l.a == 0 && l.b == 0)
				System.out.println("Impossible!");
			else if(l.a == 0) {
				double y = -Double.valueOf(l.c) / l.b;
				QuadraticEquation qex = c.getQEX(y);
				List<Double> x = qex.solve();
				if(x == null || x.isEmpty())
					System.out.println("Impossible!");
				else if(x.size() == 1)
					System.out.printf("%.2f %.2f\n", round(x.get(0), 2), round(y, 2));
				else
					System.out.printf("%.2f %.2f\n", round(Math.min(x.get(0), x.get(1)), 2), round(y, 2));
			} else if(l.b == 0) {
				double x = -Double.valueOf(l.c) / l.a;
				QuadraticEquation qey = c.getQEY(x);
				List<Double> y = qey.solve();
				if(y == null || y.isEmpty())
					System.out.println("Impossible!");
				else if(y.size() == 1)
					System.out.printf("%.2f %.2f\n", round(x, 2), round(y.get(0), 2));
				else
					System.out.printf("%.2f %.2f\n", round(x, 2), round(Math.min(y.get(0), y.get(1)), 2));
			} else {
				QuadraticEquation qex = getQEX(l, c);
				List<Double> x = qex.solve();
				if(x == null || x.isEmpty())
					System.out.println("Impossible!");
				else if(x.size() == 1) {
					double y1 = -(l.a * x.get(0) + l.c) / l.b;
					System.out.printf("%.2f %.2f\n", round(x.get(0), 2), round(y1, 2));
				} else {
					double y1 = -(l.a * x.get(0) + l.c) / l.b, y2 = -(l.a * x.get(1) + l.c) / l.b;
					if(x.get(0) < x.get(1) || x.get(0) == x.get(1) && y1 <= y2)
						System.out.printf("%.2f %.2f\n", round(x.get(0), 2), round(y1, 2));
					else
						System.out.printf("%.2f %.2f\n", round(x.get(1), 2), round(y2, 2));
				}
			}
		}
	}
	private static double round(double v, int d) {
		double den = Math.pow(10, d);
		return Math.round(v * den) / den;
	}
}
